#include "mainwindow.h"

#include <QApplication>
#include "external/paramo/paramo.h"
#include "map/mapview.h"
#include "map/infoview.h"
#include "terraria/terraview.h"
#include "terraria/terramodel.h"
#include "external/sync-layer/composer.h"


int main(int argc, char *argv[])
{
    // 初始化Paramo
    Paramo::init(1, "config.json", "json");

    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    // 创建地形模型，在地形图层之前
    terra_model = std::make_shared<TerraModel>();

    // 在主窗口建立后创建图层
    map_view    = std::make_shared<MapView>();
    info_view   = std::make_shared<InfoView>();
    terra_view  = std::make_shared<TerraView>();

    // 决定绘制顺序
    COMPOSER->insert(map_view);
    COMPOSER->insert(terra_view);
    COMPOSER->insert(info_view);

    return a.exec();
}
